<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on指令</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="app">
        <button v-on:click="clickMe1()">按钮1</button>
        <button v-on:click="clickMe2">按钮2</button>
        <button @click="changeColor('red')">变红色</button>
        <button @click="changeColor('green')">变绿色</button>
        <button @click="changeColor('blue')">变蓝色</button>
    </div>
</body>

</html>
<script>

    var vm = new Vue({
        el: "#app",
        methods: {
            clickMe1() {
                console.log("按钮1被执行了")
            },
            clickMe2: function () {
                console.log("按钮2被执行了")
            },
            changeColor(param) {
                console.log(param)
            }
        },

    })


</script>